// 校验
import VeeValidate from "vee-validate";

import zh_CN from "vee-validate/dist/locale/zh_CN";
export default function(Vue){
    Vue.use(VeeValidate);
VeeValidate.Validator.localize("zh_CN", {
	messages: {
		...zh_CN.messages,
		regex: (name) => `${name}的值不符合我定义的正则`,
		is: (name) => `${name}的值必须和密码一致`,
	},
	// 对中文字段进行中文名的配置
	attributes: {
		phone: "手机号",
		code: "验证码",
		password: "密码",
		passAgain: "确认密码",
		agree: "协议",
	},
});

// 自定义规则
VeeValidate.Validator.extend("agree", {
	validate: (value) => {
		return value;
	},
	getMessage: (m) => {
		return `${m}必须同意`;
	},
});
}